# vim:ts=4:sw=4:noet:
""" Custom UI events """

import wx

EVT_LOG_ID = wx.NewId()

class LogMsgEvent(wx.PyEvent):
	def __init__(self, data):
		wx.PyEvent.__init__(self)
		self.SetEventType(EVT_LOG_ID)
		self.data = data

EVT_UISTATE_ID = wx.NewId()

class UiStateEvent(wx.PyEvent):
	def __init__(self, type, data):
		wx.PyEvent.__init__(self)
		self.SetEventType(EVT_UISTATE_ID)
		self.type = type
		self.data = data

EVT_COMPILE_ID = wx.NewId()

class CompileEvent(wx.PyEvent):
	def __init__(self, data):
		wx.PyEvent.__init__(self)
		self.SetEventType(EVT_COMPILE_ID)
		self.data = data

EVT_DEVICEUPGRADE_ID = wx.NewId()

class DeviceUpgradeEvent(wx.PyEvent):
	def __init__(self, data):
		wx.PyEvent.__init__(self)
		self.SetEventType(EVT_DEVICEUPGRADE_ID)
		self.data = data

EVT_DEVICECHANGE_ID = wx.NewId()

class DeviceChangeEvent(wx.PyEvent):
	def __init__(self, id, name=None, conn=None):
		wx.PyEvent.__init__(self)
		self.SetEventType(EVT_DEVICECHANGE_ID)
		self.id = id
		self.name = name
		self.conn = conn

EVT_THREADEXCEPTION_ID = wx.NewId()

class ThreadExceptionEvent(wx.PyEvent):
	def __init__(self, data):
		wx.PyEvent.__init__(self)
		self.SetEventType(EVT_THREADEXCEPTION_ID)
		self.data = data
